home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / intern1a / frmmain.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-10-03  |  8.8 KB  |  285 lines

  1. VERSION 5.00
  2. Object = "{608009F3-E1FB-11D2-9BA1-0040D0002C80}#1.0#0"; "NSLOCK15VB6.OCX"
  3. Begin VB.Form frmMain 
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "Internet LOCKDOWN!"
  6.    ClientHeight    =   6165
  7.    ClientLeft      =   45
  8.    ClientTop       =   330
  9.    ClientWidth     =   5190
  10.    Icon            =   "frmMain.frx":0000
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    Moveable        =   0   'False
  15.    ScaleHeight     =   6165
  16.    ScaleWidth      =   5190
  17.    StartUpPosition =   2  'CenterScreen
  18.    Begin VB.TextBox Text1 
  19.       Height          =   285
  20.       IMEMode         =   3  'DISABLE
  21.       Left            =   3720
  22.       Locked          =   -1  'True
  23.       PasswordChar    =   "*"
  24.       TabIndex        =   8
  25.       Text            =   "Intruder"
  26.       Top             =   3720
  27.       Visible         =   0   'False
  28.       Width           =   1095
  29.    End
  30.    Begin VB.CommandButton Command2 
  31.       Caption         =   "Options"
  32.       Height          =   255
  33.       Left            =   3480
  34.       TabIndex        =   7
  35.       Top             =   0
  36.       Width           =   855
  37.    End
  38.    Begin VB.CommandButton Command1 
  39.       Caption         =   "Register"
  40.       Height          =   255
  41.       Left            =   0
  42.       TabIndex        =   6
  43.       Top             =   0
  44.       Width           =   975
  45.    End
  46.    Begin nslock15vb6.ActiveLock ActiveLock1 
  47.       Left            =   480
  48.       Top             =   3600
  49.       _ExtentX        =   847
  50.       _ExtentY        =   820
  51.       Password        =   "YourPassword"
  52.       SoftwareName    =   "Internet LOCKDOWN!"
  53.       LiberationKeyLength=   16
  54.       SoftwareCodeLength=   16
  55.    End
  56.    Begin VB.Timer Timer2 
  57.       Enabled         =   0   'False
  58.       Interval        =   1000
  59.       Left            =   3840
  60.       Top             =   5040
  61.    End
  62.    Begin VB.Timer Timer1 
  63.       Enabled         =   0   'False
  64.       Interval        =   1
  65.       Left            =   4200
  66.       Top             =   5040
  67.    End
  68.    Begin VB.CommandButton CmdPassword 
  69.       Caption         =   "OK"
  70.       Default         =   -1  'True
  71.       Enabled         =   0   'False
  72.       Height          =   255
  73.       Left            =   3480
  74.       TabIndex        =   2
  75.       Top             =   3120
  76.       Width           =   855
  77.    End
  78.    Begin VB.TextBox txtpassword 
  79.       Height          =   285
  80.       IMEMode         =   3  'DISABLE
  81.       Left            =   1680
  82.       PasswordChar    =   "*"
  83.       TabIndex        =   1
  84.       Top             =   3120
  85.       Width           =   1695
  86.    End
  87.    Begin VB.Label Label1 
  88.       Caption         =   "If you are off of the internet, click on the check."
  89.       ForeColor       =   &H00FF0000&
  90.       Height          =   255
  91.       Left            =   360
  92.       TabIndex        =   5
  93.       Top             =   5880
  94.       Width           =   3375
  95.    End
  96.    Begin VB.Image Image1 
  97.       Height          =   480
  98.       Left            =   3840
  99.       Picture         =   "frmMain.frx":030A
  100.       Top             =   5640
  101.       Width           =   480
  102.    End
  103.    Begin VB.Label lblCountdown 
  104.       Alignment       =   2  'Center
  105.       Caption         =   "180"
  106.       BeginProperty Font 
  107.          Name            =   "Comic Sans MS"
  108.          Size            =   72
  109.          Charset         =   0
  110.          Weight          =   400
  111.          Underline       =   0   'False
  112.          Italic          =   0   'False
  113.          Strikethrough   =   0   'False
  114.       EndProperty
  115.       ForeColor       =   &H0000FF00&
  116.       Height          =   1815
  117.       Left            =   1200
  118.       TabIndex        =   4
  119.       Top             =   3720
  120.       Width           =   2415
  121.    End
  122.    Begin VB.Label lblpassword 
  123.       Caption         =   "Enter Password:"
  124.       Height          =   255
  125.       Left            =   480
  126.       TabIndex        =   3
  127.       Top             =   3120
  128.       Width           =   1215
  129.    End
  130.    Begin VB.Label lblDescription 
  131.       BeginProperty Font 
  132.          Name            =   "MS Sans Serif"
  133.          Size            =   13.5
  134.          Charset         =   0
  135.          Weight          =   400
  136.          Underline       =   0   'False
  137.          Italic          =   0   'False
  138.          Strikethrough   =   0   'False
  139.       EndProperty
  140.       Height          =   2655
  141.       Left            =   720
  142.       TabIndex        =   0
  143.       Top             =   240
  144.       Width           =   3615
  145.    End
  146. Attribute VB_Name = "frmMain"
  147. Attribute VB_GlobalNameSpace = False
  148. Attribute VB_Creatable = False
  149. Attribute VB_PredeclaredId = True
  150. Attribute VB_Exposed = False
  151. Public Function IsConnected() As Boolean
  152.     Dim TRasCon(255) As RASCONN95
  153.     Dim lg As Long
  154.     Dim lpcon As Long
  155.     Dim RetVal As Long
  156.     Dim Tstatus As RASCONNSTATUS95
  157.     '
  158.     TRasCon(0).dwSize = 412
  159.     lg = 256 * TRasCon(0).dwSize
  160.     '
  161.     RetVal = RasEnumConnections(TRasCon(0), lg, lpcon)
  162.     If RetVal <> 0 Then
  163.         MsgBox "ERROR"
  164.         Exit Function
  165.     End If
  166.     '
  167.     Tstatus.dwSize = 160
  168.     RetVal = RasGetConnectStatus(TRasCon(0).hRasCon, Tstatus)
  169.     If Tstatus.RasConnState = &H2000 Then
  170.         IsConnected = True
  171.     Else
  172.         IsConnected = False
  173.     End If
  174. End Function
  175. Private Sub CmdPassword_Click()
  176. If txtPassword.Text = Text1.Text Then
  177. Unload Me
  178. Unload frmOptions
  179. Unload frmRegister
  180. Unload frmLogin
  181. MsgBox "Wrong Password!"
  182. End If
  183. End Sub
  184. Private Sub Command1_Click()
  185. Load frmRegister
  186. frmRegister.Show
  187. End Sub
  188. Private Sub Command2_Click()
  189. Load frmLogin
  190. frmLogin.Show
  191. End Sub
  192. Private Sub Command3_Click()
  193. DeleteSetting App.Title, "LockDown"
  194. End Sub
  195. Private Sub Form_Load()
  196. 'Retrieve Option Settings
  197. frmOptions.OptShutdown.Value = GetSetting(App.Title, "Lockdown", "OptShutdown")
  198. frmOptions.OptLogOff.Value = GetSetting(App.Title, "Lockdown", "Logoff")
  199. frmOptions.OptForce.Value = GetSetting(App.Title, "Lockdown", "Force")
  200. frmOptions.OptReboot.Value = GetSetting(App.Title, "Lockdown", "Reboot")
  201. If ActiveLock1.RegisteredUser = False Then
  202. frmMain.Caption = "Internet LOCKDOWN!!  Evaluation day " & ActiveLock1.UsedDays & " of 21."
  203. frmMain.Caption = "Internet LOCKDOWN!!"
  204. End If
  205. lblCountdown.Caption = Countdown
  206. Countdown = GetSetting(App.Title, "Lockdown", "Countdown")
  207. lblCountdown.Caption = GetSetting(App.Title, "Lockdown", "Countdown")
  208. Text1.Text = GetSetting(App.Title, "Lockdown", "password")
  209. ActiveLock1.Password = "powerauthority"
  210. If Not (ActiveLock1.RegisteredUser) And ActiveLock1.UsedDays > 21 Then
  211.   MsgBox "Your evaluation period has expired! Now Shutting down program!"
  212. End If
  213. If (ActiveLock1.LastRunDate > Now) Then
  214.   MsgBox "Please, correct your time settings and try again!"
  215.   End
  216. End If
  217. If ActiveLock1.RegisteredUser Then
  218.   MsgBox "You haven't registered yet!  Please register today!"
  219.   MsgBox "You have " & 21 - ActiveLock1.UsedDays & " days left!"
  220.   Load frmRegister
  221.   frmRegister.Show
  222. End If
  223. Dim hSysMenu As Long
  224. hSysMenu = GetSystemMenu(hwnd, False)
  225. RemoveMenu hSysMenu, SC_CLOSE, MF_BYCOMMAND
  226. Timer1.Enabled = True
  227. frmMain.Visible = False
  228. App.TaskVisible = False
  229. lblDescription.Caption = "Enter the correct password to be on the Internet.  You have " & Countdown & " seconds to disconnect, otherwise, the computer will restart and you will lose everything!"
  230. End Sub
  231. Private Sub Picture1_Click()
  232. End Sub
  233. Private Sub Image1_Click()
  234. If IsConnected = False Then
  235.     Timer1.Enabled = True
  236.     Timer2.Enabled = False
  237. Me.Visible = False
  238. MsgBox "Don't lie, you know you're not off."
  239. MsgBox "For that, the timer time will be cut in half!"
  240. Timer2.Interval = Timer2.Interval / 2
  241. End If
  242. End Sub
  243. Private Sub Timer1_Timer()
  244. If IsConnected = True Then
  245. frmMain.Visible = True
  246. Timer2.Enabled = True
  247. End If
  248. End Sub
  249. Private Sub Timer2_Timer()
  250. If lblCountdown.Caption = "" Then
  251. Load frmOptions
  252. frmOptions.Show
  253. If lblCountdown.Caption <= 60 Then
  254. lblCountdown.ForeColor = &HFF&
  255. End If
  256. lblCountdown.Caption = lblCountdown - 1
  257. If lblCountdown.Caption = "0" Then
  258.     If frmOptions.OptShutdown.Value = True Then
  259.       Dim res As Boolean
  260.     res = ExitWindowsEx(EWX_SHUTDOWN, 1)
  261.     ElseIf frmOptions.OptReboot.Value = True Then
  262.       Dim res1 As Boolean
  263.     res1 = ExitWindowsEx(EWX_REBOOT, 2)
  264.     ElseIf frmOptions.OptLogOff.Value = True Then
  265.     Dim res2 As Boolean
  266.     res2 = ExitWindowsEx(EWX_LOGOFF, 0)
  267.     ElseIf frmOptions.OptForce.Value = True Then
  268.     Shutdown = 4
  269.     Dim res3 As Boolean
  270.     res3 = ExitWindowsEx(EWX_FORCE, 4)
  271.     End If
  272. Unload frmLogin
  273. Unload frmMain
  274. Unload frmOptions
  275. Unload frmRegister
  276. End If
  277. End If
  278. End Sub
  279. Private Sub txtPassword_Change()
  280. If txtPassword.Text = Text1.Text Then
  281. CmdPassword.Enabled = True
  282. CmdPassword.Enabled = False
  283. End If
  284. End Sub
  285.